package com.作业.Day4;

import java.util.Scanner;

public class Homework4 {
    public static void main(String[] args) {
      while(true){
          Administrator administrator = new Administrator();
          administrator.name="admin1";
          administrator.password=11111;
          Scanner scanner = new Scanner(System.in);
          System.out.print("请输入用户名:");
          String name = scanner.next();
          System.out.print("请输入密码:");
          int password = scanner.nextInt();
          if(name.equals(administrator.name)&& password==administrator.password){
              System.out.println("请输入新的密码");
              int newPassword = scanner.nextInt();
              administrator.password=newPassword;
              System.out.println("修改密码成功，您的密码为:123456");
              break;
          }
          else
              System.out.println("用户名和密码不匹配！您没有权限更新管理员信息");
      }
    }
}
